package com.example.express.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class User {
    private int id;
    private String nickname;
    private String idNumber;
    private String phoneNumber;
    private String password;
    private Timestamp registDate;
    private Timestamp loginTime;
    private boolean user;

    public boolean isUser() {
        return user;
    }

    public void setUser(boolean user) {
        this.user = user;
    }

    public User() {
    }

    public User(int id, String nickname, String idNumber, String phoneNumber, String password, Timestamp registDate, Timestamp loginTime) {
        this.id = id;
        this.nickname = nickname;
        this.idNumber = idNumber;
        this.phoneNumber = phoneNumber;
        this.password = password;
        this.registDate = registDate;
        this.loginTime = loginTime;
    }

    public User(String nickname, String idNumber, String phoneNumber, String password) {
        this.nickname = nickname;
        this.idNumber = idNumber;
        this.phoneNumber = phoneNumber;
        this.password = password;
    }

    public User(int id, String nickname, String idNumber, String phoneNumber, String password) {
        this.id = id;
        this.nickname = nickname;
        this.idNumber = idNumber;
        this.phoneNumber = phoneNumber;
        this.password = password;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getIdNumber() {
        return idNumber;
    }

    public void setIdNumber(String idNumber) {
        this.idNumber = idNumber;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getRegistDate() {
        return registDate;
    }

    public void setRegistDate(Timestamp registDate) {
        this.registDate = registDate;
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id && Objects.equals(nickname, user.nickname) && Objects.equals(idNumber, user.idNumber) && Objects.equals(phoneNumber, user.phoneNumber) && Objects.equals(password, user.password) && Objects.equals(registDate, user.registDate) && Objects.equals(loginTime, user.loginTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, nickname, idNumber, phoneNumber, password, registDate, loginTime);
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", nickname='" + nickname + '\'' +
                ", idNumber='" + idNumber + '\'' +
                ", phoneNumber='" + phoneNumber + '\'' +
                ", password='" + password + '\'' +
                ", registDate=" + registDate +
                ", loginTime=" + loginTime +
                '}';
    }
}
